import os
def Read(name):
    result=os.popen('sc query %s' % name).read()
    print(result)
def IsRuning(name):
    result=os.popen('sc query %s' % name).read()
    return 'RUNNING' in result
def Stop(name):
    result=os.popen('sc stop %s' % name).read()
def Start(name):
    result=os.popen('sc start %s' % name).read()
def IsSTOPPED(name):
    result=os.popen('sc query %s' % name).read()
    return 'STOPPED' in result
def IsSTART_PENDING(name):
    result=os.popen('sc query %s' % name).read()
    return 'START_PENDING' in result
def IsSTOP_PENDING(name):
    result=os.popen('sc query %s' % name).read()
    return 'STOP_PENDING' in result